package com.wcy.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.LearningResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wcy.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 吴传亿
 * @since 2025-04-27
 */
public interface LearningResourceMapper extends BaseMapper<LearningResource> {
    @Results({
            @Result(property = "resourceId", column = "resource_id"),
            @Result(property = "tags", column = "resource_id",many = @Many(select = "com.wcy.mapper.ResourceTagMapper.selectTagsByResourceId")),
    })
    @Select("<script>select * from learning_resource <where> ${ew.sqlSegment}</where></script>")
    Page<LearningResource> selectPage(Page<LearningResource> page, @Param("ew") Wrapper<LearningResource> wrapper);
}

